function mountain:surf_fill/calc_min
function mountain:surf_fill/calc_max
function mountain:surf_fill/calc_diff
function mountain:surf_fill/init_surf

# init loop
execute at @e[limit=1,tag=mt_surf_fill_in1] run summon minecraft:shulker ~ ~ ~ {NoGravity: 1b, Tags: ["surf_fill_pos"], NoAI: true}
execute store result entity @e[limit=1,tag=surf_fill_pos] Pos[0] double 1 run scoreboard players get x0 mt_surf_fill
execute store result entity @e[limit=1,tag=surf_fill_pos] Pos[1] double 1 run scoreboard players get y0 mt_surf_fill
execute store result entity @e[limit=1,tag=surf_fill_pos] Pos[2] double 1 run scoreboard players get z0 mt_surf_fill

scoreboard players set xL mt_surf_fill 0
function mountain:surf_fill/loop_x
kill @e[tag=surf_fill_pos]